package day15_Thread.demo04_Thread;
//void sleep(long millis)	使当前正在执行的线程暂停指定的毫秒数
//void join()	等待这个线程的死亡
//void setDaemon(boolean on)	将此线程标记为守护线程,当运行的线程都是守护线程时,Java虚拟机将退出
public class MyThread extends Thread {
    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 1; i <= 100; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
            if (i == 50) {
                try {
                    sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
